package com.cpi.cornpp.common.files.dto;

import java.util.Calendar;

import com.cs.common.utils.StringUtils;

public class SAPComponentExchangeRateDTO implements SAPComponentDTO {
	private static final long serialVersionUID = 3359259474542795568L;
	private String code;
	private String originCurrency;
	private String destinationCurrency;
	private Calendar date;
	private double amount;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getOriginCurrency() {
		return originCurrency;
	}
	public void setOriginCurrency(String originCurrency) {
		this.originCurrency = originCurrency;
	}
	public String getDestinationCurrency() {
		return destinationCurrency;
	}
	public void setDestinationCurrency(String destinationCurrency) {
		this.destinationCurrency = destinationCurrency;
	}
	public Calendar getDate() {
		return date;
	}
	public void setDate(Calendar date) {
		this.date = date;
	}
	public double getAmount() {
		return amount;
	}
	public void setAmount(double amount) {
		this.amount = amount;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object object) {
		boolean equal = false;
		SAPComponentExchangeRateDTO sapComponentExchangeRateDTO = null;
		if( this == object ){
			equal = true;
		}else{
			if( this instanceof SAPComponentExchangeRateDTO ){
				sapComponentExchangeRateDTO = (SAPComponentExchangeRateDTO)object;
				if( this.hashCode() == sapComponentExchangeRateDTO.hashCode() ){
					equal = true;
				}
			}
		}
		return equal;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode(){
		int hash = 0;
		hash = (this.code!=null?this.code.hashCode():0);
		hash += (this.originCurrency!=null?this.originCurrency.hashCode():0);
		hash += (this.destinationCurrency!=null?this.destinationCurrency.hashCode():0);
		hash += (this.date!=null?this.date.hashCode():0);
		hash += new Double(this.amount).hashCode();
		return hash;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		StringBuffer toStringValue = null;
		toStringValue = new StringBuffer(0);
		toStringValue.append(getClass().getName());
		toStringValue.append(STRING_COLON);
		toStringValue.append(this.code);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.originCurrency);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.destinationCurrency);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.date!=null?this.date.getTime().toString():StringUtils.EMPTY_STRING);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.amount);
		return toStringValue.toString();
	}
}